1 Public Class FrmPENDING_STOCK_LIST
2
3     Private Sub FrmPENDING_STOCK_LIST_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
4         
'sqlSTR = "SELECT Pending_ID as 'Pending ID', TBL_Pending_Item.Item_ID as 'Item ID', Item_Name as 'Name', Item_Description as 'Item_Description',Pending_Date as 'Date', Item_QTY as 'Quantity' " & _
5         
' "FROM TBL_Pending_Item " & _
6         
' "INNER JOIN TBL_Category_Item_File ON TBL_Pending_Item.Item_ID = TBL_Category_Item_File.Item_ID " & _
7         
' "WHERE Returnx = 'No'"
8
9         sqlSTR =
"SELECT Pending_ID as 'Pending ID', TBL_Pending_Item.Item_ID as 'Item ID', " & _
10                  
"Replace(Replace(Item_Name,'$.$',''''),'$..$',',') as 'Name', Item_Description as 'Description / Item Number', " & _
11                  
"Pending_Date as 'Date', Item_QTY as 'Quantity' " & _
12                  
"FROM TBL_Pending_Item " & _
13                  
"INNER JOIN TBL_Category_Item_File ON TBL_Pending_Item.Item_ID = TBL_Category_Item_File.Item_ID " & _
14                  
"WHERE TBL_Pending_Item.Pending_ID NOT IN (SELECT Pending_ID FROM TBL_Deffective_PO_Details) "
15
16         FillListView(ExecuteSQLQuery(sqlSTR), lstdeffect,
0)
17         
'For x = 0 To lstdeffect.Items.Count - 1
18         
' sqlSTR = "SELECT * FROM TBL_Deffective_PO_Details WHERE Pending_ID =" & lstdeffect.Items(x).Text
19         
' ExecuteSQLQuery(sqlSTR)
20         
' If sqlDT.Rows.Count > 0 Then
21         
' lstdeffect.Items(x).ForeColor = Color.Brown
22         
' Else
23         
' lstdeffect.Items(x).ForeColor = Color.Black
24         
' End If
25         
' Next
26     End Sub
27
28     Private Sub cmdcancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdcancel.Click
29         
'Pending_ID = 0
30         Me.Close()
31     End Sub
32
33     Private Sub cmdselect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdselect.Click
34         If lstdeffect.Items.Count >
0 Then
35             lstdeffect.Focus()
36             Pending_ID = lstdeffect.FocusedItem.Text
37             Pending_Item_ID = lstdeffect.FocusedItem.SubItems(
1).Text
38             Pending_QTY = lstdeffect.FocusedItem.SubItems(
5).Text
39             sqlSTR =
"SELECT TBL_Purchase_Order.Purchase_ID as 'Purchase ID', TBL_Suppliers.SuppName as 'Supplier Name', Delivery_Term as 'Delivery Term', Purchased_Date as 'Purchase Date' " & _
40                      
"FROM ((TBL_Purchase_Order " & _
41                      
"INNER JOIN TBL_Suppliers ON TBL_Purchase_Order.Supp_ID = TBL_Suppliers.Supp_ID) " & _
42                      
"INNER JOIN TBL_Purchase_Detail ON TBL_Purchase_Order.Purchase_ID = TBL_Purchase_Detail.Purchase_ID) " & _
43                      
"WHERE TBL_Purchase_Detail.Item_ID =" & lstdeffect.FocusedItem.SubItems(1).Text & _
44                      
" ORDER BY TBL_Purchase_Order.Purchase_ID"
45             FillListView(ExecuteSQLQuery(sqlSTR), FrmDEFFECTIVE_PO_LIST.lstpo,
0)
46             Me.Close()
47         End If
48     End Sub
49 End Class


Gõ tìm kiếm nhanh...